package uml.view.factory;

import uml.eventsystem.events.UMLEventId;
import uml.objects.UMLObject;

/**
 * This class will decide what factory is needed to be called when requesting an object to add
 * to the diagram panel. It will call the correct factory whether its a class or arrow.
 * @author Sean McKay
 * 
 */

public final class UMLObjectFactory
{
	/**
	 * Creates UMLObject based on <tt>UMLEventId</tt>
	 * @param eventId
	 * @return
	 */
	
	public static final UMLObject createUMLObject (UMLEventId eventId)
	{
		if (eventId.is (UMLEventId.ARROW_FACTORY))
			return RelationshipArrowFactory.createObject (eventId);
		else if (eventId.is (UMLEventId.CLASS_FACTORY))
			return ClassFormatterFactory.createFormatter (eventId);
		else
			return null;
	}
}
